<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader: SB Loader</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Common bootloader for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__sbloader.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">Modules</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">SB Loader</div>  </div>
</div><!--header-->
<div class="contents">

<p>SB file loader state machine.  
<a href="#details">More...</a></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for SB Loader:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<center><table><tr><td><div class="center"><iframe scrolling="no" frameborder="0" src="group__sbloader.svg" width="252" height="38"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</td></tr></table></center>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group__sb__file__format"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sb__file__format.html">SB File Format</a></td></tr>
<tr class="memdesc:group__sb__file__format"><td class="mdescLeft">&#160;</td><td class="mdescRight">SB file format definitions. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structboot__cmd__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#structboot__cmd__t">boot_cmd_t</a></td></tr>
<tr class="memdesc:structboot__cmd__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Boot command definition.  <a href="group__sbloader.html#structboot__cmd__t">More...</a><br /></td></tr>
<tr class="separator:structboot__cmd__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structboot__hdr1__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#structboot__hdr1__t">boot_hdr1_t</a></td></tr>
<tr class="memdesc:structboot__hdr1__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition for boot image file header chunk 1.  <a href="group__sbloader.html#structboot__hdr1__t">More...</a><br /></td></tr>
<tr class="separator:structboot__hdr1__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structboot__hdr2__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#structboot__hdr2__t">boot_hdr2_t</a></td></tr>
<tr class="memdesc:structboot__hdr2__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition for boot image file header chunk 2.  <a href="group__sbloader.html#structboot__hdr2__t">More...</a><br /></td></tr>
<tr class="separator:structboot__hdr2__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:struct__ldr___context"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#struct__ldr___context">ldr_Context_t</a></td></tr>
<tr class="memdesc:struct__ldr___context"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader context definition.  <a href="group__sbloader.html#struct__ldr___context">More...</a><br /></td></tr>
<tr class="separator:struct__ldr___context"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:struct__ldr__buf"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#struct__ldr__buf">ldr_buf_t</a></td></tr>
<tr class="separator:struct__ldr__buf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga91cd342631b2d6671e45540010036636"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga91cd342631b2d6671e45540010036636"></a>
typedef uint8_t&#160;</td><td class="memItemRight" valign="bottom"><b>chunk_t</b>[BYTES_PER_CHUNK]</td></tr>
<tr class="separator:ga91cd342631b2d6671e45540010036636"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0245e0acbad099fc68373e9510a30e2a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0245e0acbad099fc68373e9510a30e2a"></a>
typedef <a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga0245e0acbad099fc68373e9510a30e2a">pLdrFnc_t</a>) (ldr_Context_t *)</td></tr>
<tr class="memdesc:ga0245e0acbad099fc68373e9510a30e2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function pointer definition for all loader action functions. <br /></td></tr>
<tr class="separator:ga0245e0acbad099fc68373e9510a30e2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4c78980909d12afd94251b0d8a0e6d72"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4c78980909d12afd94251b0d8a0e6d72"></a>
typedef <a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga4c78980909d12afd94251b0d8a0e6d72">pJumpFnc_t</a>) (uint32_t)</td></tr>
<tr class="memdesc:ga4c78980909d12afd94251b0d8a0e6d72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Jump command function pointer definition. <br /></td></tr>
<tr class="separator:ga4c78980909d12afd94251b0d8a0e6d72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1de0f1c5f7def685737224bccd4e427d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1de0f1c5f7def685737224bccd4e427d"></a>
typedef <a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga1de0f1c5f7def685737224bccd4e427d">pCallFnc_t</a>) (uint32_t, uint32_t *)</td></tr>
<tr class="memdesc:ga1de0f1c5f7def685737224bccd4e427d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Call command function pointer definition. <br /></td></tr>
<tr class="separator:ga1de0f1c5f7def685737224bccd4e427d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga776140b8326b3fbe0d466c71e7f424e4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga776140b8326b3fbe0d466c71e7f424e4"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga776140b8326b3fbe0d466c71e7f424e4">_sbloader_status</a> { <br />
&#160;&#160;<b>kStatusRomLdrSectionOverrun</b> = MAKE_STATUS(kStatusGroup_SBLoader, 0), 
<br />
&#160;&#160;<b>kStatusRomLdrSignature</b> = MAKE_STATUS(kStatusGroup_SBLoader, 1), 
<br />
&#160;&#160;<b>kStatusRomLdrSectionLength</b> = MAKE_STATUS(kStatusGroup_SBLoader, 2), 
<br />
&#160;&#160;<b>kStatusRomLdrUnencryptedOnly</b> = MAKE_STATUS(kStatusGroup_SBLoader, 3), 
<br />
&#160;&#160;<b>kStatusRomLdrEOFReached</b> = MAKE_STATUS(kStatusGroup_SBLoader, 4), 
<br />
&#160;&#160;<b>kStatusRomLdrChecksum</b> = MAKE_STATUS(kStatusGroup_SBLoader, 5), 
<br />
&#160;&#160;<b>kStatusRomLdrCrc32Error</b> = MAKE_STATUS(kStatusGroup_SBLoader, 6), 
<br />
&#160;&#160;<b>kStatusRomLdrUnknownCommand</b> = MAKE_STATUS(kStatusGroup_SBLoader, 7), 
<br />
&#160;&#160;<b>kStatusRomLdrIdNotFound</b> = MAKE_STATUS(kStatusGroup_SBLoader, 8), 
<br />
&#160;&#160;<b>kStatusRomLdrDataUnderrun</b> = MAKE_STATUS(kStatusGroup_SBLoader, 9), 
<br />
&#160;&#160;<b>kStatusRomLdrJumpReturned</b> = MAKE_STATUS(kStatusGroup_SBLoader, 10), 
<br />
&#160;&#160;<b>kStatusRomLdrCallFailed</b> = MAKE_STATUS(kStatusGroup_SBLoader, 11), 
<br />
&#160;&#160;<b>kStatusRomLdrKeyNotFound</b> = MAKE_STATUS(kStatusGroup_SBLoader, 12), 
<br />
&#160;&#160;<b>kStatusRomLdrSecureOnly</b> = MAKE_STATUS(kStatusGroup_SBLoader, 13), 
<br />
&#160;&#160;<b>kStatusRomLdrResetReturned</b> = MAKE_STATUS(kStatusGroup_SBLoader, 14)
<br />
 }<tr class="memdesc:ga776140b8326b3fbe0d466c71e7f424e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">SB loader status codes. <br /></td></tr>
</td></tr>
<tr class="separator:ga776140b8326b3fbe0d466c71e7f424e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1536554f61934f8efda2c88d6ffb320c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga1536554f61934f8efda2c88d6ffb320c"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga1536554f61934f8efda2c88d6ffb320c">_ldr_memory_space</a> { <br />
&#160;&#160;<b>kLdrMemorySpace_Internal</b>, 
<br />
&#160;&#160;<b>kLdrMemorySpace_eMMC0</b>, 
<br />
&#160;&#160;<b>kLdrMemorySpace_SD0</b>, 
<br />
&#160;&#160;<b>kLdrMemorySpace_SDRAM0</b>, 
<br />
&#160;&#160;<b>kLdrMemorySpace_IFR0</b>, 
<br />
&#160;&#160;<b>kLdrMemorySpace_eFuse0</b>, 
<br />
&#160;&#160;<b>kLdrMemorySpace_OTP0</b>
<br />
 }<tr class="memdesc:ga1536554f61934f8efda2c88d6ffb320c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Memory Space constants. <br /></td></tr>
</td></tr>
<tr class="separator:ga1536554f61934f8efda2c88d6ffb320c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab6bc76cbbc27492728383544ea731c72"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab6bc76cbbc27492728383544ea731c72"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gab6bc76cbbc27492728383544ea731c72">_ldr_memory_ctrl</a> { <br />
&#160;&#160;<b>kLdrMemoryCtrl_InternalFlash</b>, 
<br />
&#160;&#160;<b>kLdrMemoryCtrl_QSPI0</b>, 
<br />
&#160;&#160;<b>kLdrMemoryCtrl_PNOR0</b>
<br />
 }<tr class="memdesc:gab6bc76cbbc27492728383544ea731c72"><td class="mdescLeft">&#160;</td><td class="mdescRight">Memory Controller constants. <br /></td></tr>
</td></tr>
<tr class="separator:gab6bc76cbbc27492728383544ea731c72"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga196130e1b193207247c017a437943ea5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga196130e1b193207247c017a437943ea5"></a>
<a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga196130e1b193207247c017a437943ea5">sbloader_init</a> (void)</td></tr>
<tr class="memdesc:ga196130e1b193207247c017a437943ea5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the loader state machine. <br /></td></tr>
<tr class="separator:ga196130e1b193207247c017a437943ea5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga839acaad7be8bbbec73522fe70c32302"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga839acaad7be8bbbec73522fe70c32302"></a>
<a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga839acaad7be8bbbec73522fe70c32302">sbloader_pump</a> (uint8_t *data, uint32_t length)</td></tr>
<tr class="memdesc:ga839acaad7be8bbbec73522fe70c32302"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pump the loader state machine. <br /></td></tr>
<tr class="separator:ga839acaad7be8bbbec73522fe70c32302"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab83b73573b68707e69221c1417fd452d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab83b73573b68707e69221c1417fd452d"></a>
<a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gab83b73573b68707e69221c1417fd452d">sbloader_finalize</a> ()</td></tr>
<tr class="memdesc:gab83b73573b68707e69221c1417fd452d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implement jump or reset command. <br /></td></tr>
<tr class="separator:gab83b73573b68707e69221c1417fd452d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga715727e893b93f41dbc9c1e2fa5296a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga715727e893b93f41dbc9c1e2fa5296a7">ldr_GoToNextSection</a> (ldr_Context_t *)</td></tr>
<tr class="memdesc:ga715727e893b93f41dbc9c1e2fa5296a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader utilities.  <a href="#ga715727e893b93f41dbc9c1e2fa5296a7">More...</a><br /></td></tr>
<tr class="separator:ga715727e893b93f41dbc9c1e2fa5296a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4c7887c97e9f07681ad1be30dab94987"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4c7887c97e9f07681ad1be30dab94987"></a>
<a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga4c7887c97e9f07681ad1be30dab94987">sbloader_handle_chunk</a> (void)</td></tr>
<tr class="memdesc:ga4c7887c97e9f07681ad1be30dab94987"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles the chunk in the s_loaderBuf. <br /></td></tr>
<tr class="separator:ga4c7887c97e9f07681ad1be30dab94987"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0a93051137241cb158be82f76c41cffb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga0a93051137241cb158be82f76c41cffb">ldr_DoHeader</a> (ldr_Context_t *)</td></tr>
<tr class="memdesc:ga0a93051137241cb158be82f76c41cffb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader action (context.Action) functions for header processing.  <a href="#ga0a93051137241cb158be82f76c41cffb">More...</a><br /></td></tr>
<tr class="separator:ga0a93051137241cb158be82f76c41cffb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga97fb3ae2cb77369d17f3e1274885aa54"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga97fb3ae2cb77369d17f3e1274885aa54">ldr_DoHeader1</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:ga97fb3ae2cb77369d17f3e1274885aa54"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader action function processes header chunk 1.  <a href="#ga97fb3ae2cb77369d17f3e1274885aa54">More...</a><br /></td></tr>
<tr class="separator:ga97fb3ae2cb77369d17f3e1274885aa54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad57986c8600fbcc2336d5d8ff7247b1c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gad57986c8600fbcc2336d5d8ff7247b1c">ldr_DoHeader2</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:gad57986c8600fbcc2336d5d8ff7247b1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader action function processes header chunk 2.  <a href="#gad57986c8600fbcc2336d5d8ff7247b1c">More...</a><br /></td></tr>
<tr class="separator:gad57986c8600fbcc2336d5d8ff7247b1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabc6ed95c2d394a248aab821e4e12a0d6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gabc6ed95c2d394a248aab821e4e12a0d6">ldr_DoHeaderMac</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:gabc6ed95c2d394a248aab821e4e12a0d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader action function finishes CBC-MAC over final header chunks.  <a href="#gabc6ed95c2d394a248aab821e4e12a0d6">More...</a><br /></td></tr>
<tr class="separator:gabc6ed95c2d394a248aab821e4e12a0d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0315e4cec526531d325e5cbd3cbe921b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga0315e4cec526531d325e5cbd3cbe921b">ldr_DoKeyTest</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:ga0315e4cec526531d325e5cbd3cbe921b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader action function tests for a key dictionary match.  <a href="#ga0315e4cec526531d325e5cbd3cbe921b">More...</a><br /></td></tr>
<tr class="separator:ga0315e4cec526531d325e5cbd3cbe921b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac0e29a6ef84e5150d434ac167a2a6362"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gac0e29a6ef84e5150d434ac167a2a6362">ldr_DoGetDek</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:gac0e29a6ef84e5150d434ac167a2a6362"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader action function processes a key dictionary match.  <a href="#gac0e29a6ef84e5150d434ac167a2a6362">More...</a><br /></td></tr>
<tr class="separator:gac0e29a6ef84e5150d434ac167a2a6362"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad4ba3d76f1d6c2be59aa4822161e7080"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad4ba3d76f1d6c2be59aa4822161e7080"></a>
<a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gad4ba3d76f1d6c2be59aa4822161e7080">ldr_DoInit</a> (ldr_Context_t *)</td></tr>
<tr class="memdesc:gad4ba3d76f1d6c2be59aa4822161e7080"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader action (context.Action) functions for command processing. <br /></td></tr>
<tr class="separator:gad4ba3d76f1d6c2be59aa4822161e7080"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf82590b20d223f900afb0526629af78c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gaf82590b20d223f900afb0526629af78c">ldr_DoCommand</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:gaf82590b20d223f900afb0526629af78c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader boot command parsing function.  <a href="#gaf82590b20d223f900afb0526629af78c">More...</a><br /></td></tr>
<tr class="separator:gaf82590b20d223f900afb0526629af78c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaed3ef0bc94387ab2b5710c64a7c81ff3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gaed3ef0bc94387ab2b5710c64a7c81ff3">ldr_DoLoadBytes</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:gaed3ef0bc94387ab2b5710c64a7c81ff3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader action function loads the trailing "ragged edge bytes".  <a href="#gaed3ef0bc94387ab2b5710c64a7c81ff3">More...</a><br /></td></tr>
<tr class="separator:gaed3ef0bc94387ab2b5710c64a7c81ff3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad336bbae43e8ca08f9300397b316d0bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gad336bbae43e8ca08f9300397b316d0bb">ldr_DoLoadChunks</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:gad336bbae43e8ca08f9300397b316d0bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader action function loads data chunks.  <a href="#gad336bbae43e8ca08f9300397b316d0bb">More...</a><br /></td></tr>
<tr class="separator:gad336bbae43e8ca08f9300397b316d0bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga179d2dbc48908c8880f0d1c38fdf0118"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga179d2dbc48908c8880f0d1c38fdf0118">ldr_DoLoadCmd</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:ga179d2dbc48908c8880f0d1c38fdf0118"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader "load" command handler.  <a href="#ga179d2dbc48908c8880f0d1c38fdf0118">More...</a><br /></td></tr>
<tr class="separator:ga179d2dbc48908c8880f0d1c38fdf0118"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga391e8156461e75bf9c458a8c239aa668"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga391e8156461e75bf9c458a8c239aa668">ldr_DoFillCmd</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:ga391e8156461e75bf9c458a8c239aa668"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader "fill" command handler.  <a href="#ga391e8156461e75bf9c458a8c239aa668">More...</a><br /></td></tr>
<tr class="separator:ga391e8156461e75bf9c458a8c239aa668"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3a3306081691ef431d63ce7ad1ade981"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga3a3306081691ef431d63ce7ad1ade981">ldr_DoJumpCmd</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:ga3a3306081691ef431d63ce7ad1ade981"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader "jump" command handler.  <a href="#ga3a3306081691ef431d63ce7ad1ade981">More...</a><br /></td></tr>
<tr class="separator:ga3a3306081691ef431d63ce7ad1ade981"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga08fefb64c1909e91cc855695d4c29d88"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga08fefb64c1909e91cc855695d4c29d88">ldr_DoCallCmd</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:ga08fefb64c1909e91cc855695d4c29d88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader "call" command handler.  <a href="#ga08fefb64c1909e91cc855695d4c29d88">More...</a><br /></td></tr>
<tr class="separator:ga08fefb64c1909e91cc855695d4c29d88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga16375b0cc8350f605d7cf5f2c2302b99"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga16375b0cc8350f605d7cf5f2c2302b99">ldr_DoTagCmd</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:ga16375b0cc8350f605d7cf5f2c2302b99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader "tag" command handler.  <a href="#ga16375b0cc8350f605d7cf5f2c2302b99">More...</a><br /></td></tr>
<tr class="separator:ga16375b0cc8350f605d7cf5f2c2302b99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd574bf6ff4543b4e4bb642de4edd0ad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gabd574bf6ff4543b4e4bb642de4edd0ad">ldr_DoEraseCmd</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:gabd574bf6ff4543b4e4bb642de4edd0ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader "erase" command handler.  <a href="#gabd574bf6ff4543b4e4bb642de4edd0ad">More...</a><br /></td></tr>
<tr class="separator:gabd574bf6ff4543b4e4bb642de4edd0ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga72544d4d3e21c991c3e26cd1a408d9e7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga72544d4d3e21c991c3e26cd1a408d9e7">ldr_DoResetCmd</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:ga72544d4d3e21c991c3e26cd1a408d9e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader "reset" command handler.  <a href="#ga72544d4d3e21c991c3e26cd1a408d9e7">More...</a><br /></td></tr>
<tr class="separator:ga72544d4d3e21c991c3e26cd1a408d9e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad7a59b324c66828cc084b18a964bf3d6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#gad7a59b324c66828cc084b18a964bf3d6">ldr_DoMemEnableCmd</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:gad7a59b324c66828cc084b18a964bf3d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader "memory enable" command handler.  <a href="#gad7a59b324c66828cc084b18a964bf3d6">More...</a><br /></td></tr>
<tr class="separator:gad7a59b324c66828cc084b18a964bf3d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga736cf77e8cd8dbef2c7cf2194281d796"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga736cf77e8cd8dbef2c7cf2194281d796">ldr_DoProgramCmd</a> (ldr_Context_t *context)</td></tr>
<tr class="memdesc:ga736cf77e8cd8dbef2c7cf2194281d796"><td class="mdescLeft">&#160;</td><td class="mdescRight">Loader "program" command handler.  <a href="#ga736cf77e8cd8dbef2c7cf2194281d796">More...</a><br /></td></tr>
<tr class="separator:ga736cf77e8cd8dbef2c7cf2194281d796"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:ga6900924e02ee40bd281f9655a672a5cc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga6900924e02ee40bd281f9655a672a5cc"></a>
static ldr_Context_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga6900924e02ee40bd281f9655a672a5cc">s_loaderContext</a></td></tr>
<tr class="memdesc:ga6900924e02ee40bd281f9655a672a5cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">static loader context data. <br /></td></tr>
<tr class="separator:ga6900924e02ee40bd281f9655a672a5cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8bd4c85b5ac97233a4f6d141a8b3b838"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga8bd4c85b5ac97233a4f6d141a8b3b838"></a>
static ldr_buf_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga8bd4c85b5ac97233a4f6d141a8b3b838">s_loaderBuf</a></td></tr>
<tr class="memdesc:ga8bd4c85b5ac97233a4f6d141a8b3b838"><td class="mdescLeft">&#160;</td><td class="mdescRight">static buffer queueing up a chunk worth of data <br /></td></tr>
<tr class="separator:ga8bd4c85b5ac97233a4f6d141a8b3b838"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga44f04e86cd75f107e97ea3f948fc65c7"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sbloader.html#ga44f04e86cd75f107e97ea3f948fc65c7">s_aesKey</a> [AES_128_KEY_SIZE_WORDS]</td></tr>
<tr class="separator:ga44f04e86cd75f107e97ea3f948fc65c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Usage Information</h2>
<p>SB file loader state machine. </p>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structboot__cmd__t" id="structboot__cmd__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct boot_cmd_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>Boot command definition. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ac0d31ca829f934cccd89f8054e02773e"></a>uint32_t</td>
<td class="fieldname">
address</td>
<td class="fielddoc">
address argument </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a59eac9627282a484fbaf0aa7aa3b8a9a"></a>uint8_t</td>
<td class="fieldname">
checksum</td>
<td class="fielddoc">
8-bit checksum over command chunk </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a86988a65e0d3ece7990c032c159786d6"></a>uint32_t</td>
<td class="fieldname">
count</td>
<td class="fielddoc">
count argument </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a1e43bf7d608e87228b625cca2c04d641"></a>uint32_t</td>
<td class="fieldname">
data</td>
<td class="fielddoc">
data argument </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a1e87af3c18a2fd36c61faf89949bdc3f"></a>uint16_t</td>
<td class="fieldname">
flags</td>
<td class="fielddoc">
command flags (modifier) </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a50ffde9be79dd080d9e8effe3ee52d66"></a>uint8_t</td>
<td class="fieldname">
tag</td>
<td class="fielddoc">
command tag (identifier) </td></tr>
</table>

</div>
</div>
<a name="structboot__hdr1__t" id="structboot__hdr1__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct boot_hdr1_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>Definition for boot image file header chunk 1. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a522c456248878bb557496ee9378a3d7f"></a>uint32_t</td>
<td class="fieldname">
fileChunks</td>
<td class="fielddoc">
total chunks in the file </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aee7c63a38575c45dbbfb42d4175e62cc"></a>uint16_t</td>
<td class="fieldname">
fileFlags</td>
<td class="fielddoc">
global file flags </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a11ecb029164e055f28f4123ce3748862"></a>uint32_t</td>
<td class="fieldname">
hash</td>
<td class="fielddoc">
last 32-bits of SHA-1 hash </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a5bd4e4c943762926c8f653b6224cced2"></a>uint8_t</td>
<td class="fieldname">
major</td>
<td class="fielddoc">
major file format version </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ae2f416b0a34b7beb4ed3873d791ac393"></a>uint8_t</td>
<td class="fieldname">
minor</td>
<td class="fielddoc">
minor file format version </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="acd2a6284879dded65f0b8daa7c68485a"></a>uint32_t</td>
<td class="fieldname">
signature</td>
<td class="fielddoc">
must equal "STMP" </td></tr>
</table>

</div>
</div>
<a name="structboot__hdr2__t" id="structboot__hdr2__t"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct boot_hdr2_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>Definition for boot image file header chunk 2. </p>
</div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a5201e6634f83af91b52b19a094da866b"></a>uint32_t</td>
<td class="fieldname">
bootOffset</td>
<td class="fielddoc">
chunk offset to the first boot section </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ab1d8063887a5703d08991ff3c1a09cfb"></a>uint32_t</td>
<td class="fieldname">
bootSectID</td>
<td class="fielddoc">
section ID of the first boot section </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a0b929d82928397451b15e9c5b6fe9f0b"></a>uint16_t</td>
<td class="fieldname">
hdrChunks</td>
<td class="fielddoc">
number of chunks in the header </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a7e5512fd8e604fd1d9b9d38da4c5350f"></a>uint16_t</td>
<td class="fieldname">
keyCount</td>
<td class="fielddoc">
number of keys in the key dictionary </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="adffa18f0c236456f5bd980d12d0921a4"></a>uint16_t</td>
<td class="fieldname">
keyOffset</td>
<td class="fielddoc">
chunk offset to the key dictionary </td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ae80cf2d01b7912e3586ad6054c73540f"></a>uint16_t</td>
<td class="fieldname">
sectCount</td>
<td class="fielddoc">
number of sections in the image </td></tr>
</table>

</div>
</div>
<a name="struct__ldr___context" id="struct__ldr___context"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct _ldr_Context</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"><p>Loader context definition. </p>
</div><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="closed.png" alt="+"/> Collaboration diagram for ldr_Context_t:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="struct__ldr___context__coll__graph.svg" width="224" height="127"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a3213142f96234fd7f5a586fac74bb0d6"></a><a class="el" href="group__sbloader.html#ga0245e0acbad099fc68373e9510a30e2a">pLdrFnc_t</a></td>
<td class="fieldname">
Action</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a8e464f0c6b02d095d3ccf03356e8e8ff"></a><a class="el" href="group__sbloader.html#structboot__cmd__t">boot_cmd_t</a></td>
<td class="fieldname">
bootCmd</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ac1d547b76086b31bddcb1df49f828b2d"></a>uint32_t</td>
<td class="fieldname">
bootSectChunks</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ab60412d96d4f25f904c6844e1fd3bda0"></a><a class="el" href="group__crc32.html#structcrc32__data__t">crc32_data_t</a></td>
<td class="fieldname">
crc32</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="af43fa166aa3599d4af6dd25ad58a7632"></a>chunk_t</td>
<td class="fieldname">
dek</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a522c456248878bb557496ee9378a3d7f"></a>uint32_t</td>
<td class="fieldname">
fileChunks</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="aee7c63a38575c45dbbfb42d4175e62cc"></a>uint16_t</td>
<td class="fieldname">
fileFlags</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a57237ff9906ebc85138659eca92dafc5"></a>chunk_t</td>
<td class="fieldname">
initVector</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a7e5512fd8e604fd1d9b9d38da4c5350f"></a>uint16_t</td>
<td class="fieldname">
keyCount</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ab5aaef2a7a253b993dd63041bee9a81a"></a>uint32_t</td>
<td class="fieldname">
objectID</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="abe2d16d67161846a087e149a7fe8d45e"></a>uint32_t</td>
<td class="fieldname">
receivedChunks</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a86efbbb0824781da1c49fc5ec2a29e30"></a>chunk_t</td>
<td class="fieldname">
scratchPad</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a87cbf7d0b7120b1c1b8e37ed6c4d3966"></a>uint32_t</td>
<td class="fieldname">
sectChunks</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a327b13f81c2d5fd60b1723be79972bad"></a>uint32_t</td>
<td class="fieldname">
skipCount</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a11a93f7333694b4c3ebec2b63a505be0"></a>bool</td>
<td class="fieldname">
skipToEnd</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="ae942a57ecd176dfe6c323f68754e74bd"></a>uint8_t *</td>
<td class="fieldname">
src</td>
<td class="fielddoc">
</td></tr>
</table>

</div>
</div>
<a name="struct__ldr__buf" id="struct__ldr__buf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct _ldr_buf</td>
        </tr>
      </table>
</div><div class="memdoc">
<div class="textblock"></div><table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a8a965b5d7688e6cc35c240bb7a10ddee"></a>chunk_t</td>
<td class="fieldname">
data</td>
<td class="fielddoc">
</td></tr>
<tr><td class="fieldtype">
<a class="anchor" id="a4d576ac4701c8e41d43b0b9c26a903c8"></a>uint32_t</td>
<td class="fieldname">
fillPosition</td>
<td class="fielddoc">
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga08fefb64c1909e91cc855695d4c29d88"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoCallCmd </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader "call" command handler. </p>
<p>Implements the action function for the boot "call" command.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>*context is setup to get the next boot command. </dd>
<dd>
context-&gt;objectID is set to the next boot section or image ID.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>Return code from plugin or ldr_GoToNextSection. </dd></dl>

</div>
</div>
<a class="anchor" id="gaf82590b20d223f900afb0526629af78c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoCommand </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader boot command parsing function. </p>
<p>Implements the action function for parsing a boot command. Performs generic integrity tests and flag handling, then calls the appropriate command handler function based on the command tag.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatusRomLdrChecksum</td><td>if command checksum failed. </td></tr>
    <tr><td class="paramname">kStatusRomLdrUnknownCommand</td><td>if command tag is not recognized. </td></tr>
    <tr><td class="paramname">Return</td><td>code from the boot command handler function. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gabd574bf6ff4543b4e4bb642de4edd0ad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoEraseCmd </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader "erase" command handler. </p>
<p>Implements the action function for the boot "erase" command.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>*context is setup to get the next boot command. </dd>
<dd>
context-&gt;sectChunks is updated to the next section.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
    <tr><td class="paramname">kStatus_InvalidArgument</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga391e8156461e75bf9c458a8c239aa668"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoFillCmd </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader "fill" command handler. </p>
<p>Implements the action function for the boot "fill" command.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>*context is left setup to get the next boot command.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gac0e29a6ef84e5150d434ac167a2a6362"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoGetDek </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader action function processes a key dictionary match. </p>
<p>This loader action function is one of three functions used to parse the key dictionary. It is called after a match of the CBC-MAC is found and the session key (DEK) is decrypted. It saves the DEK in the boot context and then skips to the first boot command in the image. This function will only get called if CBC_MAC is supported</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;src points to the the encrypted session key. </dd>
<dd>
context-&gt;initVector contains the SHA-1 chunk from the header</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>*context is setup to decrypt the first boot command. </dd>
<dd>
The session key is decrypted and stored in the context dek field</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>Return value from <a class="el" href="group__sbloader.html#ga715727e893b93f41dbc9c1e2fa5296a7" title="Loader utilities. ">ldr_GoToNextSection()</a>. </dd></dl>

</div>
</div>
<a class="anchor" id="ga0a93051137241cb158be82f76c41cffb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoHeader </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader action (context.Action) functions for header processing. </p>
<p>Loader action function processes the first header chunk.</p>
<p>Processes the first header chunk of the boot image file, which saves the SHA-1 to the context initVector field, the CBC-MAC process is started here to handle the DEK if one is found</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;src points at the current header chunk.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>context-&gt;Action is set to process the next header chunk.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCCESS</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga97fb3ae2cb77369d17f3e1274885aa54"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoHeader1 </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader action function processes header chunk 1. </p>
<p>Processes the second header chunk of the boot image file, which contains the file signature, version, flags and chunk count.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;src points at the current header chunk.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>context-&gt;Action is set to process the next header chunk. </dd>
<dd>
context-&gt;fileChunks and fileFlags are set to the header values.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
    <tr><td class="paramname">kStatusRomLdrSignature</td><td>if the signature or version are incorrect. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gad57986c8600fbcc2336d5d8ff7247b1c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoHeader2 </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader action function processes header chunk 2. </p>
<p>Processes the third header chunk of the boot image file, which contains parameters for the first boot section and the key dictionary.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;src points at the current header chunk.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>context-&gt;Action is set to process the next header chunk. </dd>
<dd>
context-&gt;sectChunks, objectID and keyCount are set to the header values.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
    <tr><td class="paramname">kStatusRomLdrSectionLength</td><td>if the bootOffset is out of range. </td></tr>
    <tr><td class="paramname">kStatusRomLdrUnencryptedOnly</td><td>if the unencrypted image is disabled. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gabc6ed95c2d394a248aab821e4e12a0d6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoHeaderMac </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader action function finishes CBC-MAC over final header chunks. </p>
<p>Completes the CBC-MAC calculation over the remaining plaintext header. This function will only get called if CBC_MAC is supported</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;src points at the current header chunk. </dd>
<dd>
context-&gt;bootCmd.count = number of chunks left in plaintext header.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>context-&gt;scratchPad contains the computed CBC-MAC. </dd>
<dd>
context-&gt;bootCmd.count is updated.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCCESS</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga3a3306081691ef431d63ce7ad1ade981"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoJumpCmd </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader "jump" command handler. </p>
<p>Implements the action function for the boot "jump" command.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatusRomLdrJumpReturned</td><td>if the plugin returns </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0315e4cec526531d325e5cbd3cbe921b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoKeyTest </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader action function tests for a key dictionary match. </p>
<p>This loader action function is one of three functions used to parse the key dictionary. It is called after a CBC-MAC entry from the dictionary has been read. If the value read is equal to the computed CBC-MAC, then the next encrypted chunk holds the session key (DEK), and the next action function will decrypt the key. Otherwise if there are remaining entries in the dictionary, the next action will get the next CBC-MAC to test.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;dek holds the CBC-MAC computed over the header. </dd>
<dd>
context-&gt;src holds a CBC-MAC value from the dictionary.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>if CBC-MAC matches we transition to decrypt the DEK </dd>
<dd>
context-&gt;keyCount is updated to the remaining number of keys to test.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">SUCCESS</td><td></td></tr>
    <tr><td class="paramname">ERROR_ROM_LDR_KEY_NOT_FOUND</td><td>if there are no more entries in the dictionary and a CBC-MAC match was not found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaed3ef0bc94387ab2b5710c64a7c81ff3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoLoadBytes </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader action function loads the trailing "ragged edge bytes". </p>
<p>Implements the second of two action functions for the boot "load" command. The last move sequence for the load command moves the final payload chunk. This function checks the payload CRC, then copies the final load bytes to the load destination.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command. </dd>
<dd>
context-&gt;src contains the final decrypted payload chunk. </dd>
<dd>
context-&gt;crc32 holds the CRC calculated over the entire payload.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>*context is setup to get the next boot command. </dd></dl>

</div>
</div>
<a class="anchor" id="gad336bbae43e8ca08f9300397b316d0bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoLoadChunks </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader action function loads data chunks. </p>
<p>Implements the first of two action functions for the boot "load" command. Loads one or more complete "chunk size" blocks of data.</p>
<p>If the amount of data remaining to load is one chunk or less, it sets the state sequence to move the next chunk. The action function is changed to <a class="el" href="group__sbloader.html#gaed3ef0bc94387ab2b5710c64a7c81ff3">ldr_DoLoadBytes</a>, which will check the payload CRC and copy to the correct location.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>context-&gt;bootCmd is adjusted to reflect the previous move. </dd>
<dd>
context-&gt;Action is set to move the next received payload.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga179d2dbc48908c8880f0d1c38fdf0118"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoLoadCmd </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader "load" command handler. </p>
<p>Implements the first command handler called for the boot "load" command. The load action is split into two functions:</p><ul>
<li><a class="el" href="group__sbloader.html#gad336bbae43e8ca08f9300397b316d0bb">ldr_DoLoadChunks</a>, loads chunks</li>
<li><a class="el" href="group__sbloader.html#gaed3ef0bc94387ab2b5710c64a7c81ff3">ldr_DoLoadBytes</a>, loads the trailing "ragged edge bytes" This function initializes the context before calling load action.</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gad7a59b324c66828cc084b18a964bf3d6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoMemEnableCmd </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader "memory enable" command handler. </p>
<p>Implements the action function for the boot "memory enable" command.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>*context is setup to get the next boot command. </dd>
<dd>
context-&gt;sectChunks is updated to the next section.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
    <tr><td class="paramname">kStatus_InvalidArgument</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga736cf77e8cd8dbef2c7cf2194281d796"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoProgramCmd </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader "program" command handler. </p>
<p>Implements the action function for the boot "program" command.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>*context is left setup to get the next boot command.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga72544d4d3e21c991c3e26cd1a408d9e7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoResetCmd </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader "reset" command handler. </p>
<p>Implements the action function for the boot "reset" command.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>*context is setup to get the next boot command. </dd>
<dd>
context-&gt;sectChunks is updated to the next section.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga16375b0cc8350f605d7cf5f2c2302b99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_DoTagCmd </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader "tag" command handler. </p>
<p>Implements the action function for the boot "tag" command.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">context</td><td>Pointer to a loader context structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section pre"><dt>Precondition</dt><dd>context-&gt;bootCmd contains the boot command.</dd></dl>
<dl class="section post"><dt>Postcondition</dt><dd>*context is setup to get the next boot command. </dd>
<dd>
context-&gt;sectChunks is updated to the next section.</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatusRomLdrSectionLength</td><td>if new section count is out of range. </td></tr>
    <tr><td class="paramname">kStatusRomLdrIdNotFound</td><td>if no match and no more sections. </td></tr>
    <tr><td class="paramname">Return</td><td>code from ldr_GoToNextSection. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga715727e893b93f41dbc9c1e2fa5296a7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__ksdk__common.html#gaaabdaf7ee58ca7269bd4bf24efcde092">status_t</a> ldr_GoToNextSection </td>
          <td>(</td>
          <td class="paramtype">ldr_Context_t *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Loader utilities. </p>
<p>Skip ahead to the next "tag" command.</p>
<p>function will set up the skipCount to skip over the remainder of any section  you are currently in. If encryption is enabled it will also re-init the encryption  to begin on the new section it arrives at.</p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">kStatus_Success</td><td></td></tr>
    <tr><td class="paramname">kStatusRomLdrEOFReached</td><td>if the end of the image file is reached. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="ga44f04e86cd75f107e97ea3f948fc65c7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t s_aesKey[AES_128_KEY_SIZE_WORDS]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Pointer for the aes which will for now be a null pointer unless in debug mode we will try to read from the config area </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 7 2016 16:48:23 for Kinetis Bootloader by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
